﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://wubiyu.cnblogs.com">
<head>
      <title></title>
      <link href="../../Theme/DomExtGray/gray.min.css" rel="Stylesheet" type="text/css" />
      <link href="PageModel.css" rel="Stylesheet" type="text/css" />
      <script type="text/javascript" src="../../domExt.min.js"></script>
</head>
<body>
      <div class="fun_title">
            _h.GetEvent();
      </div>
      <div class="fun_content">
            描述：获取触发事件的 event 对象<br />
      </div>
      <div class="fun_title2">
            参数:
      </div>
      <div class="fun_content2">
            <strong>Retrun:</strong><br />
            DHTML 的 event 对象<br /><br />
      </div>
      <div class="fun_title2">
            示例:
      </div>
      <div class="code">
            &lt;div id=&quot;div1&quot; 
            onclick=&quot;div1_onclick()&quot;&gt;点我执行例子效果&lt;/div&gt;
      </div>

      <div class="code">
            &lt;script type=&quot;text/javascript&quot;&gt;<br />
&nbsp;&nbsp;&nbsp; function div1_onclick()<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var e = _h.GetEvent();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var sender = _h.GetEventArg();//获取触发事件的DOM对象。这里应是id为Div1的DOM对象。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert(sender.id);<br />
&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;<br />
            &lt;/script&gt;</div>
    
      <br />
         <div id="div1" onclick="div1_onclick()">点我执行例子效果</div> 
      <script type="text/javascript">
            function div1_onclick() {
                  var e = _h.GetEvent();
                  var sender = _h.GetEventArg();
                  alert(sender.id);
            }  
      </script>
</body>
</html>
